package com.bwie.pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 商品表
 *
 * @TableName tb_prod
 */
@TableName(value = "tb_prod")
@Data
@Document(indexName = "es_prod", shards = 1, replicas = 0)
public class TbProd implements Serializable {
    /**
     * 商品ID
     */
    @TableId(type = IdType.AUTO)
    @Id
    @Field(type = FieldType.Keyword)
    private Integer prodId;

    /**
     * 商品Spu
     */
    @Field(type = FieldType.Keyword)
    private String prodSpu;

    /**
     * 商品名称
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String prodName;

    /**
     * 商品分裂
     */
    @Field(type = FieldType.Integer)
    private Integer typeId;

    /**
     * 品牌id
     */
    @Field(type = FieldType.Integer)
    private Integer brandId;

    /**
     * 商品单位
     */
    @Field(type = FieldType.Integer)
    private Integer unitId;

    /**
     * 商品标点
     */
    @Field(type = FieldType.Integer)
    private Integer tagId;

    /**
     * 供应商id
     */
    @Field(type = FieldType.Integer)
    private Integer apprId;

    /**
     * 商品缩略图
     */
    @Field(type = FieldType.Keyword, index = false)
    private String prodImage;

    /**
     * 商品状态
     */
    @Field(type = FieldType.Integer)
    private Integer prodStatus;

    /**
     * 商品类型
     */
    @Field(type = FieldType.Integer)
    private Integer prodKind;

    /**
     * 创建时间
     */
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 创建人
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String createBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.UPDATE)
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 更新人
     */
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateBy;


    @Field(type = FieldType.Keyword, index = false)
    private String prodVideo;

    private Integer upType;

    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date upTime;

    private Integer downType;

    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date downTime;


    @Field(type = FieldType.Integer)
    private Integer checkId;

    @Field(type = FieldType.Integer)
    private Integer checkStatus;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String checkReason;


    @TableField(exist = false)
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String typeName;
    @TableField(exist = false)
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String brandName;
    @TableField(exist = false)
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String unitName;
    @TableField(exist = false)
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String tagName;
    @TableField(exist = false)
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String dictLable;
    @TableField(exist = false)
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String apprName;

    @TableField(exist = false)
    private List<TbImage> tbImageList;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}